<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" isELIgnored="false" %>
<div class="user-div_2">
    <div style="float: left;">
        <span>一共${allSize}条记录</span>&nbsp;&nbsp;
        <span>${pageIndex}/${pageCount}页</span>&nbsp;&nbsp;
        <a href="javascript:page_nav(document.forms[0], 1);" title="首页"
            <c:choose>
                <c:when test="${pageIndex <= 1}">style="pointer-events: none;cursor: default;color:lightgray;"</c:when>
                <c:when test="${pageIndex > 1}">style="pointer-events: auto;cursor: pointer;color:#87CEEB;"</c:when>
            </c:choose>
        >首页</a>&nbsp;&nbsp;
        <a href="javascript:page_nav(document.forms[0], ${pageIndex} - 1);" title="上一页"
                <c:choose>
                    <c:when test="${pageIndex <= 1}">style="pointer-events: none;cursor: default;color:lightgray;"</c:when>
                    <c:when test="${pageIndex > 1}">style="pointer-events: auto;cursor: pointer;color:#87CEEB;"</c:when>
                </c:choose>
        >&lang;</a>&nbsp;&nbsp;
        <a href="javascript:page_nav(document.forms[0], ${pageIndex} + 1);" title="下一页"
                <c:choose>
                    <c:when test="${pageIndex >= pageCount}">style="pointer-events: none;cursor: default;color:lightgray;"</c:when>
                    <c:when test="${pageIndex < pageCount}">style="pointer-events: auto;cursor: pointer;color:#87CEEB;"</c:when>
                </c:choose>
        >&rang;</a>&nbsp;&nbsp;
        <a href="javascript:page_nav(document.forms[0], ${pageCount});" title="尾页"
                <c:choose>
                    <c:when test="${pageIndex >= pageCount}">style="pointer-events: none;cursor: default;color:lightgray;"</c:when>
                    <c:when test="${pageIndex < pageCount}">style="pointer-events: auto;cursor: pointer;color:#87CEEB;"</c:when>
                </c:choose>
        >尾页</a>
    </div>
    <div style="float: right;">
        跳至<input type="text" name="inputPage" id="inputPage" />页
        <button class="user-button btnclick inshadow-white float-right" type="button" onclick="jump_to(document.forms[0],document.getElementById('inputPage').value)">GO</button>
    </div>
</div>
<%--<script type="text/javascript" src="${pageContext.request.contextPath}/JS/paging.js" charset="GBK" ></script>--%>
<script type="text/javascript">
    function page_nav(frm,index){
        frm.pageIndex.value = index;
        frm.submit();
    }
    function jump_to(frm,num){
        //验证用户的输入
        var regexp=/^[1-9]\d*$/;
        var pageCount = document.getElementById("pageCount").value;
        //alert(pageCount);
        if(!regexp.test(num)){
            alert("请输入大于0的正整数！");
            return false;
        }else if((num-pageCount) > 0){
            alert("请输入小于总页数的页码");
            return false;
        }else{
            page_nav(frm,num);
        }
    }
</script>